/// @tags:
#include <algorithm>
#include <cctype>
#include <cstdio>

typedef long long ll;

int const N = 1e5 + 5;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

int n, k, max, pos, a[N];
ll prefix[N], suffix[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("E.in", "r", stdin);
  freopen("E.out", "w", stdout);
#endif
#endif

  read(n), read(k);
  for (int i = 1; i <= n; ++i) {
    if ((prefix[i] = read(a[i])) > max) {
      max = a[i];
      pos = i;
    }
    prefix[i] += prefix[i - 1];
  }
  for (int i = n; i; --i) {
    suffix[i] = suffix[i + 1] + a[i];
  }
  printf("%lld", prefix[pos] + suffix[pos] + 1ll * a[pos] * (k - 2));
  return 0;
}